#ifndef __MODEL_H__
#define __MODEL_H__

#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

#include <myMesh.h>
#include <Shader.h>

#include "Texture.h"

#include <string>
#include <vector>

unsigned int TextureFromFile(const char *path, const std::string &directory, bool gamma = false);

class Model
{
public:
    std::vector<Mesh> meshes;
    std::string directory;
    bool gammaCorrection;

    Model(std::string const &path, std::string const &texture_path, bool gamma = false);
    void Draw(Shader &shader);

private:
    Texture texture;
    void loadModel(std::string const &path, std::string const &model_path);

    void processNode(aiNode *node, const aiScene *scene);

    Mesh processMesh(aiMesh *mesh, const aiScene *scene);
};
#endif